#include "Eigen/Dense"
#include <chrono>
#include <iostream>
#include <omp.h>

using namespace std;
using namespace Eigen;

const int dim = 5000;

int main() {
  std::chrono::time_point<std::chrono::system_clock> start, end;
  omp_set_num_threads(1);
  int n;
  n = Eigen::nbThreads();
  cout << n << "\n";

  Matrix<double, Dynamic, Dynamic> m1(dim, dim);
  Matrix<double, Dynamic, Dynamic> m2(dim, dim);
  Matrix<double, Dynamic, Dynamic> m_res(dim, dim);

  start = std::chrono::system_clock::now();

  for (int i = 0; i < 1; ++i) {
    m1.setRandom(dim, dim);
    m2.setRandom(dim, dim);
    m_res = m1 * m2;
  }

  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;

  std::cout << "elapsed time: " << elapsed_seconds.count() << "s\n";

  return 0;
}